package com.bwie.task;

import com.bwie.mapper.TbProdMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class ProdTask {
    @Autowired
    TbProdMapper tbProdMapper;

    @Scheduled(cron = "0 0/1 * * * ?")
    public void upLoadProdTask() {
        System.out.println("开始执行定时上架商品");
        tbProdMapper.upLoadProdTask();
        System.out.println("结束执行定时上架商品");
    }

    @Scheduled(cron = "0 0/1 * * * ?")
    public void downLineProdTask() {
        System.out.println("开始执行定时下架商品");
        tbProdMapper.downLineProdTask();
        System.out.println("结束执行定时下架商品");
    }
}
